package com.java.tutorials.jdk7.paths;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
 * Created by xuzhike on 2016/1/27.
 * http://www.java2s.com/Code/Java/JDK-7/ResolvesiblingPath.htm
 * Resolve sibling Path
 */
public class ResolvesiblingPath {
    public static void main(String[] args) {
        Path rootPath = Paths.get("E:\\OpenSources\\MyProjects\\test");
        Path resolvedPath = rootPath.resolve("another/test3.txt");

        resolvedPath = rootPath.resolve("folder/newFile.txt");
        System.out.println("rootPath: " + rootPath);
        System.out.println("resolvedPath: " + resolvedPath);
        System.out.println();

        resolvedPath = rootPath.resolveSibling("folder/newFile.txt");
        System.out.println("rootPath: " + rootPath);
        System.out.println("resolvedPath: " + resolvedPath);

    }
}
